<template>
  <div class="bcf pos-r">
    <div class="">
      <div style="width: 70vw;margin: 0 auto;" class="padt10">
        <mu-tabs inverse :value.sync="editTab">
          <mu-tab value="main">基本信息</mu-tab>
          <mu-tab value="product" v-if="model.id > 0">采购产品</mu-tab>
        </mu-tabs>
        <div class="bcf bdso pad5" v-show="editTab === 'main'" style="width: 70vw;min-height: 60vh">
          <EzData ref="editForm" :config="configEdit.main()" v-model="model" :key="editKey"></EzData>
        </div>
        <div class="bcf bdso pad5" v-if="editTab === 'product'" style="width: 70vw;min-height: 60vh">
          <NeedProduct :base="{belongToId:model.id}" :params="{belongToId:model.id}"></NeedProduct>
        </div>
      </div>
    </div>
    <div class="w100 tac padt10">
      <mu-button class="mar1" color="primary" @click="save">
        <mu-icon left value="save"></mu-icon>
        保存
      </mu-button>
      <mu-button class="mar1" color="warning" @click="cancelEdit">
        <mu-icon left value="close"></mu-icon>
        取消
      </mu-button>
    </div>
    <div class="pos-a t0 l0 pad10" v-if="!isComp">
      <mu-button color="primary" icon @click="goback(-1)">
        <mu-icon value="arrow_back"></mu-icon>
      </mu-button>
    </div>
  </div>
</template>

<script>
import mixin_edit from "./js/mixin_edit";
import EzData from "@/comps/EzData";
import NeedProduct from "@/pages/v1/erp/NeedProduct/NeedProduct.vue";
export default {
  name: "v1-erp-Need-edit",
  components: {NeedProduct, EzData},
  mixins: [mixin_edit],
}
</script>

<style scoped>

</style>